﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sealight.Core.DataAdapter;
using Sealight.API.Ioc;
using Sealight.CoreAPI;

namespace Sealight.UI.WebUI.Services
{
    public class ProjectService
    {
        public static IList<project> GetProjectByCategoryId(Guid categoryId)
        {
            var svc = IocContainer.Container().Resolve<IProjectService>();

            return svc.GetProjectByCategoryId(categoryId);
        }

        public static project GetProjectById(Guid id)
        {
            var svc = IocContainer.Container().Resolve<IProjectService>();

            return svc.GetById(id);
        }

        public static IList<project_category> GetAllCategory()
        {
            var svc = IocContainer.Container().Resolve<IProjectService>();
            return svc.GetAllCategory();
        }

        public static void DeleteProject(Guid id)
        {
            var svc = IocContainer.Container().Resolve<IProjectService>();
            svc.Delete(new project { id = id });
        }

        public static project AddOrUpdate(project data)
        {
            var svc = IocContainer.Container().Resolve<IProjectService>();
            return svc.AddOrUpdate(data);
        }
    }
}